package com.neusoft.elmboot.mapper;

import java.math.BigDecimal;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.neusoft.elmboot.po.Wallet;

@Mapper
public interface WalletMapper {

    @Insert("insert into wallet values(0, #{userId})")
    public int saveWallet(String userId);

    @Update("update wallet set money = #{money} where userId = #{userId}")
    public int updateMoney(String userId, BigDecimal money);

    @Select("select * from wallet where userId = #{userId}")
    public Wallet getWalletByUserid(String userId);

    @Insert("insert into wallettrans values(null,#{time},#{money},#{type},#{inId},#{outId})")
    public int saveTransaction(String time,BigDecimal money,int type,String inId,String outId);
}
